<?php
class replaceModel extends baseModel{
    protected $table = 'replace';

    //替换列表
    public function replace_list() {
        return $this->select('','','id desc');
    }

    //替换信息
    public function info($id) {
        return $this->find('id='.$id);
    }

    //添加替换
    public function add($data)
    {
        $data['num']=intval($data['num']);
        return $this->insert($data);
    }
    //编辑替换
    public function edit($data)
    {
        $condition['id']=intval($data['id']);
        $data['num']=intval($data['num']);
        return $this->update($condition,$data); 
    }
    //删除替换
    public function del($id)
    {
        return $this->delete('id='.intval($id)); 
    }

	
}